<?php


namespace addon\hotel\hotel\controller;


use addon\hotel\model\RoomNo as RoomNoModel;

class Roomno extends BaseHotel
{
    //房间列表
    public function lists()
    {
        if (request()->isAjax()){

            $room_model = new RoomNoModel();

            $page = input('page', 1);
            $page_size = input('page_size', PAGE_LIST_ROWS);

            $search_text = input('roomNo','');

            $condition = [
                ['hotel_id','=',$this->hotel_id]
            ];

            if ($search_text) {
                $condition[] = [ 'roomNo', 'like', '%' . $search_text . '%' ];
            }


            $order = 'baoyu_id desc,room_no_id desc';

            $field = '*';

            $list = $room_model->getRoomNoPageList($condition, $page, $page_size,$order,$field);

            return $list;
        }


    }
}